.class Lcom/instagram/android/b/j;
.super Ljava/lang/Object;
.source "InstagramAnalyticsLogger.java"

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lcom/instagram/android/b/h;


# direct methods
.method private constructor <init>(Lcom/instagram/android/b/h;)V
    .locals 0
    .parameter

    .prologue
    .line 471
    iput-object p1, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/instagram/android/b/h;Lcom/instagram/android/b/i;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 471
    invoke-direct {p0, p1}, Lcom/instagram/android/b/j;-><init>(Lcom/instagram/android/b/h;)V

    return-void
.end method

.method private a()V
    .locals 8

    .prologue
    const/4 v1, 0x0

    .line 485
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->d(Lcom/instagram/android/b/h;)Lcom/instagram/android/b/b;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->d(Lcom/instagram/android/b/h;)Lcom/instagram/android/b/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/android/b/b;->e()J

    move-result-wide v4

    const-wide/16 v6, 0x1388

    add-long/2addr v4, v6

    cmp-long v0, v2, v4

    if-ltz v0, :cond_0

    .line 488
    const-string v0, "InstagramAnalyticsLogger"

    const-string v2, "Sending low-latency session"

    invoke-static {v0, v2}, Lcom/facebook/e/a/a;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 493
    :try_start_0
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->e(Lcom/instagram/android/b/h;)Lcom/instagram/android/b/d;

    move-result-object v0

    iget-object v2, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v2}, Lcom/instagram/android/b/h;->d(Lcom/instagram/android/b/h;)Lcom/instagram/android/b/b;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/instagram/android/b/d;->a(Lcom/instagram/android/b/b;)Ljava/io/File;

    move-result-object v1

    .line 494
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/instagram/android/b/h;->a(Lcom/instagram/android/b/h;Lcom/instagram/android/b/b;)Lcom/instagram/android/b/b;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 499
    :goto_0
    if-eqz v1, :cond_0

    .line 502
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->f(Lcom/instagram/android/b/h;)Lcom/instagram/android/b/e;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/instagram/android/b/e;->a(Ljava/io/File;)V

    .line 505
    :cond_0
    return-void

    .line 495
    :catch_0
    move-exception v0

    .line 496
    const-string v2, "InstagramAnalyticsLogger"

    const-string v3, "Unable to store batch"

    invoke-static {v2, v3, v0}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0
.end method


# virtual methods
.method public run()V
    .locals 2

    .prologue
    .line 475
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->b(Lcom/instagram/android/b/h;)Ljava/util/concurrent/atomic/AtomicBoolean;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 477
    :goto_0
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->c(Lcom/instagram/android/b/h;)Ljava/util/Queue;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Queue;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    .line 478
    iget-object v0, p0, Lcom/instagram/android/b/j;->a:Lcom/instagram/android/b/h;

    invoke-static {v0}, Lcom/instagram/android/b/h;->c(Lcom/instagram/android/b/h;)Ljava/util/Queue;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Queue;->remove()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/b/k;

    invoke-interface {v0}, Lcom/instagram/android/b/k;->a()V

    goto :goto_0

    .line 481
    :cond_0
    invoke-direct {p0}, Lcom/instagram/android/b/j;->a()V

    .line 482
    return-void
.end method
